home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1996, 1997 Meta Four Software. All rights reserved.
- //
- // See the comments in "kbound.h" for details on how to use this code.
- //
- //! rev="$Id: kbinder.cpp,v 1.3 1997/05/27 10:42:36 jcw Rel $"
-
- #include "kbound.h"
-
- /////////////////////////////////////////////////////////////////////////////
-
- static void fCoder(bool /*encode_*/, int /*block_*/, char* ptr_, int count_)
- {
- while (--count_ > 0)
- *ptr_++ ^= 211; // very naive encoding, this is just an example
- }
-
- int main(int argc, char** argv)
- {
- bool asText = false;
-
- while (argc > 1 && argv[1][0] == '-')
- {
- --argc;
-
- switch ((*++argv)[1] | 0x20) // force to lowercase
- {
- case 't': asText = true; break;
- case 'x': c4_BoundStorage::_Encoder = fCoder; break;
- }
- }
-
- if (argc < 3)
- puts("Usage: KBINDER [-t] [-x] inputfile prefix [base]");
- else
- {
- int base = argc > 3 ? atoi(argv[3]) : 100;
-
- c4_Storage orig (argv[1], false);
- c4_BoundStorage::DumpAsRes(orig, argv[2], asText, base);
- }
-
- return 0;
- }
-
- /////////////////////////////////////////////////////////////////////////////
-